﻿/*
 *  Source code courtesy of the desktopWeb.CodePlex.com community project. See MS-PL license on Codeplex.com. 
 *  This is beta code not intended for a production application.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Excel;
using System.Windows.Forms;
using MyData.SharePoint;
using System.Windows.Forms.Integration;

namespace MyData.ExcelAddIn
{
    public partial class ThisAddIn
    {
      private void ThisAddIn_Startup(object sender, System.EventArgs e)
      {               
      }

      private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
      {
      }

      #region VSTO generated code

      /// <summary>
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// </summary>
      private void InternalStartup()
      {
          this.Startup += new System.EventHandler(ThisAddIn_Startup);
          this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
      }
        
      #endregion
    }

    //Show form with Excel as parent
    public class MyWin32Window : IWin32Window
    {
      private IntPtr _hwnd;

      public MyWin32Window(IntPtr handle)
      {
        _hwnd = handle;
      }

      public IntPtr Handle
      {
        get
        {
          return _hwnd;
        }
      }
    }
}
